package pers.kw.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import pers.kw.entity.OauthClientDetailsDO;

public interface OauthClientDetailsDao extends JpaRepository<OauthClientDetailsDO, String> {

    @Query(value = "from OauthClientDetailsDO where clientId=:clientId")
    OauthClientDetailsDO findByClientId(@Param("clientId") String clientId);

    @Modifying
    @Query(value = "delete from OauthClientDetailsDO where clientId=:clientId")
    int deleteByClientId(@Param("clientId") String clientId);
}
